%table.album
  %tr
    %td.alongside_image
      - unless @album.artwork.nil?
        %img.small_album_artwork{:src => @album.artwork.public_filename(:small), :alt => @album.name, :title => @album.name}
      - else logged_in? && current_user.is_admin?
        %p
          No album art.
          %a{:href => edit_album_url(@album)}Add some now.
    %td
      %table
        %tr
          %td
            %h1.album
              ="#{@album.name} (#{@album.year})"
        %tr
          %td
            - if @album.purchasable?
              Want to support my music? You can
              %a{:href => @album.purchase_link, :title => "Buy the album " + @album.name} buy this album
              if you'd like.
        - unless @album.songs.nil?
          %tr  
            %td.album_songs
              %table.songs
                - @album.songs.sort_by{|song| song.track}.each do |song|
                  %tr
                    %td.song_track= song.track.to_s + ". "
                    %td.song_name
                      %a{:href => song_url(song)}=song.name
                    - if song.downloadable?
                      %td.play_song
                        %object{:height => "17", :width => "17", :data => "/assets/button/musicplayer.swf?&b_colors=80FF00,257b00,197eaa,FF0000&playlist_url=" + song_url(song) + ".xml", :type => "application/x-shockwave-flash"}
                          %param{:value => "/assets/button/musicplayer.swf?&b_colors=80FF00,257b00,197eaa,FF0000&playlist_url=" + song_url(song) + ".xml", :name => "movie"}
                          %img{:height => "17", :width => "17", :alt => "play", :src => "/assets/noflash.gif"}
                        %span.download_and_buy_song
                          |
                          %a{:href => song.public_filename, :title => "Download " + song.name}
                            Download
                          - if song.purchasable?
                            or
                            %a{:href => song.purchase_link, :title => "Buy " + song.name} Buy
        - else
          %tr
            %td.albums_songs
              They're aren't any songs on this album yet.
              - if logged_in? && current_user.is_admin?
                %a{:href => edit_album_url(@album)}Add some
  - if logged_in? && current_user.is_admin?
    %tr
      %td
        %table
          %tr
            %td.field_title Edit:
            %td.field
              %a{:href => edit_album_url(@album), :title => "Edit \"#{@album.name}\"", :alt => "Edit \"#{@album.name}\""}="\"#{@album.name}\""